package cn.gson.crm.model.pojos;

import javax.persistence.*;
import java.util.List;
import java.util.Objects;


@Entity
public class Employee {
    private long ygId;
    private String yname;
    private List<Sell> sells;
    private List<Business> businesses;
    private User user;
    private Byte ygZge;
    private Long ygNumber;
    private String ygPositi;
    private String ygDepart;
    private List<Customer> customers;


    @ManyToOne
    @JoinColumn(name="Y_ID")
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }



    @OneToMany(mappedBy = "employeeByYgId")
    public List<Business> getBusinesses() {
        return businesses;
    }

    public void setBusinesses(List<Business> businesses) {
        this.businesses = businesses;
    }

    @OneToMany(mappedBy = "employeeByYgId")
    public List<Sell> getSells() {
        return sells;
    }

    public void setSells(List<Sell> sells) {
        this.sells = sells;
    }


    @OneToMany(mappedBy = "employee")
    public List<Customer> getCustomers() {
        return customers;
    }

    public void setCustomers(List<Customer> customers) {
        this.customers = customers;
    }

    @Id
    @Column(name = "yg_id")
    @GeneratedValue(generator = "seq",strategy = GenerationType.SEQUENCE)
    //定义一个序列生成器
    @SequenceGenerator(name = "seq",sequenceName = "crm",
            initialValue = 1,allocationSize = 1)
    public long getYgId() {
        return ygId;
    }

    public void setYgId(long ygId) {
        this.ygId = ygId;
    }

    @Basic
    @Column(name = "yname")
    public String getYname() {
        return yname;
    }

    public void setYname(String yname) {
        this.yname = yname;
    }

    @Basic
    @Column(name = "yg_zge")
    public Byte getYgZge() {
        return ygZge;
    }

    public void setYgZge(Byte ygZge) {
        this.ygZge = ygZge;
    }

    @Basic
    @Column(name = "yg_number")
    public Long getYgNumber() {
        return ygNumber;
    }

    public void setYgNumber(Long ygNumber) {
        this.ygNumber = ygNumber;
    }

    @Basic
    @Column(name = "yg_positi")
    public String getYgPositi() {
        return ygPositi;
    }

    public void setYgPositi(String ygPositi) {
        this.ygPositi = ygPositi;
    }

    @Basic
    @Column(name = "yg_depart")
    public String getYgDepart() {
        return ygDepart;
    }

    public void setYgDepart(String ygDepart) {
        this.ygDepart = ygDepart;
    }


}
